#include "Sync_File.h"

const string Sync_File::SyncStatus_Strings[] = { 
        "UNDEFINED",
        "READY_TO_RECEIVE",
        "READY_TO_SEND",
        "RECEIVING",
        "SENDING",
        "IN_SYNC"
};


Sync_File::Sync_File(boost::filesystem::path commonPath)  :
    base_path(),
    common_path(commonPath),
    status(UNDEFINED),
    transparent(false),
    exist_locally(false),
    estimated_size(0),

    scanning(false)
{
}

Sync_File::~Sync_File()
{
}

boost::filesystem::path Sync_File::get_base_path() const
{
    return base_path;
}

boost::filesystem::path Sync_File::get_common_path() const
{
    return common_path;
}

boost::filesystem::path Sync_File::get_whole_path() const
{
    return base_path / common_path;
}

void Sync_File::set_base_path(boost::filesystem::path basePath)
{
    base_path = basePath;
}

void Sync_File::set_common_path(boost::filesystem::path commonPath)
{
    common_path = commonPath;
}

bool Sync_File::is_transparent() const
{
    return transparent;
}

void Sync_File::set_transparent(bool transparent)
{
    this->transparent = transparent;
}

bool Sync_File::exists_locally() const
{
    return exist_locally;
}

Sync_File::SyncStatus Sync_File::get_status() const
{
    return status;
}

string Sync_File::get_status_as_string() const
{
    return SyncStatus_Strings[(uint8_t) status];
}

void Sync_File::set_status(Sync_File::SyncStatus status)
{
    this->status = status;
}

uint64_t Sync_File::get_estimatedsize() const
{
    return estimated_size;
}

void Sync_File::set_estimatedsize(uint64_t estimatedSize)
{
    estimated_size = estimatedSize;
}

void Sync_File::set_status(uint8_t status)
{
    this->status = (Sync_File::SyncStatus) status;
}

void Sync_File::set_exist_locally(bool existLocally)
{
    exist_locally = existLocally;
}







